package didi;

import java.util.*;

public class Main {

    public  int maxSum=0;

    public  void dfs(Set<Integer> setA, Set<Integer> setB, Set<Integer> setC, int n, int path, Map<Integer,Set<Integer>> rule){
        if (path == n+1){
            if (setA.size() == setB.size()){
                maxSum = maxSum > setA.size() ? maxSum : setA.size();
            }
            return ;
        }

        // 2-若过于失衡也退出
        int temp = setA.size() - setB.size();
        temp = temp >0 ? temp : -temp;
        if (temp > n - setC.size()) return;

        // 3.1-a
        boolean canPut2A = true;
        Set<Integer> ruleA = rule.get(path);
        if (null != ruleA){
            for (int i: ruleA){
                if (setA.contains(i)){
                    canPut2A = false;
                }
            }
        }
        if (canPut2A){
            setA.add(path);
            dfs(setA,setB,setC,n,path+1,rule);
            setA.remove(path);
        }

        // 3.2-b
        boolean canPut2B = true;
        Set<Integer> ruleB = rule.get(path);
        if (null != ruleB){
            for (int i: ruleB){
                if (setB.contains(i)){
                    canPut2B = false;
                }
            }
        }
        if (canPut2B){
            setB.add(path);
            dfs(setA,setB,setC,n,path+1,rule);
            setB.remove(path);
        }

        // 3.3-c
        setC.add(path);
        dfs(setA,setB,setC,n,path+1,rule);
        setC.remove(path);

    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        HashMap<Integer, Set<Integer>> rule = new HashMap<Integer, Set<Integer>>();
        //HashSet<Integer> rule = new HashSet<Integer>();
        for(int i=0;i<m;i++){
            int a =sc.nextInt();
            int b = sc.nextInt();
            int max = a>b?a:b;
            int min = a<b?a:b;
            if (null == rule.get(min)){
                HashSet<Integer> integers = new HashSet<Integer>();
                integers.add(max);
                rule.put(min,integers);
            }else{
                Set<Integer> integers = rule.get(min);
                integers.add(max);
            }
        }

        HashSet<Integer> setA = new HashSet<Integer>();
        HashSet<Integer> setB = new HashSet<Integer>();
        HashSet<Integer> setC = new HashSet<Integer>();
        //maxSum = 0;

        Main res = new Main();
        res.maxSum=0;
        res.dfs(setA,setB,setC,n,1,rule);
        System.out.print(res.maxSum*2);
    }
}
